<?php

namespace Fluency\Web\Routing;

/**
 * An interface for classes that can try to return a request corresponding to a provided string,
 * which is usually a part of an URL, for example, the PATH_INFO segment.
 *
 * Implementations of this interface should generally be immutable.
 *
 * @package Fluency\Web\Routing
 * @author  Ignas Rudaitis
 * @since   1.0
 */
interface Router
{
    /**
     * Returns a Request if it can be mapped to the given string or NULL otherwise.
     *
     * @param string $url
     * @return Fluency\Web\Http\Request|null
     */
    public function query($url);
}
